package edu.sctu.practice.class01.wujiayi.assing03.practice02;

/**
 * Created by acer1 on 2015/10/24.
 */
public class ComparableCircle extends Circle implements Comparable {

    public ComparableCircle(float r){
        this.r = r;
    }


    @Override
    public int compareTo(Object o) {

        if (getArea()>((ComparableCircle)o).getArea()){
            return 0;
        }
        else {
            return 1;
        }
    }

    private double getArea(){
        return  r*r*Math.PI;
    }
}
